Skip to content
This repository has been archived by the owner on Sep 7, 2020. It is now read-only.

Feature/add device information tlv to topology response #705

Merged

Conversation

mariomaz
Copy link
Collaborator

[TASK] Add Device Information TLV to Topology Response message #700

@ghost ghost assigned mariomaz Jan 21, 2020
Copy link
Collaborator

@tomereli tomereli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commit 3cf23b9 headline should be "bcl: utils: add method to get interface speed".
Also, the description should also explain a bit which TLV needs this information and for which interfaces we require to know the speed.

Other than that - LGTM, so approving. Any reason this still a draft?

std::shared_ptr<ieee1905_1::cLocalInterfaceInfo> localInterfaceInfo =
tlvDeviceInformation->create_local_interface_list();

ieee1905_1::eMediaType media_type = ieee1905_1::eMediaType::UNKNONWN_MEDIA;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think all this can go to a static function:

static bool fill_iface_info(ieee1905_1::tlvDeviceInformation &info, const std::string iface, const sMacAddr &iface_mac);

Then call it - fill_iface_info(*info, bridge_info.iface, network_utils::mac_from_string(bridge_info.mac));

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We still have to add a LocalInterfaceInfo field for each wireless interface. I'll refactor this code when I had the full picture. Promise.

@ghost ghost added this to the M1 - Certifiable agent with wired backhaul milestone Feb 3, 2020
@ghost
Copy link

ghost commented Feb 6, 2020

@mariomaz What's the status of this PR? Can it be merged soon?

@mariomaz mariomaz force-pushed the feature/add_device_information_tlv_to_topology_response branch from 8acd78b to eb992df Compare February 7, 2020 10:14
@mariomaz mariomaz marked this pull request as ready for review February 7, 2020 10:27
@mariomaz
Copy link
Collaborator Author

mariomaz commented Feb 7, 2020

I have addressed requested changes, rebased onto master and changed the state to "Ready for review".
"[TASK] Add Device Information TLV to Topology Response message #700" cannot be fully completed until standard commands can be sent with DWPAL (I've updated task description accordingly and added a TODO comment in code).
However, this PR could be already merged as is (if no further changes are required).

Copy link
Collaborator

@arnout arnout left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One bug, one important comment about the disappearing todos, but everything can be fixed up easily, so approving already.

@arnout arnout added the don't merge This PR is not ready for merge or review label Feb 7, 2020
@mariomaz mariomaz force-pushed the feature/add_device_information_tlv_to_topology_response branch from eb992df to dcdb761 Compare February 10, 2020 16:53
@ghost ghost removed the don't merge This PR is not ready for merge or review label Feb 11, 2020
The nested type in `tlvDeviceInformation` was written as struct. This
was done when TLVF didn't support nested classes yet. However, it must
be a class since it has dynamically-sized content. Convert struct to
class and change its name accordingly.

Rename fields that do not match with those defined in the IEEE 1905
standard. Rename fields which type and purpose is not clear enough.

Change type of media_info field from eMediaType to array of uint8_t
since it is a variable length array which length media_info_length
and contents depend on the value of media_type field.

Signed-off-by: Mario Maz <[email protected]>
Signed-off-by: Mario Maz <[email protected]>
Ethernet interface speed is required to compute the MediaType field
in different TLVs. It is also required to compute the PHY rate when
collecting link metrics.

Signed-off-by: Mario Maz <[email protected]>
@mariomaz mariomaz force-pushed the feature/add_device_information_tlv_to_topology_response branch from 2d4db46 to 6d6ec35 Compare February 11, 2020 17:36
@mariomaz mariomaz merged commit c8faead into master Feb 11, 2020
@mariomaz mariomaz deleted the feature/add_device_information_tlv_to_topology_response branch February 11, 2020 17:50
@mariomaz mariomaz linked an issue Apr 8, 2020 that may be closed by this pull request
2 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[TASK] Add Device Information TLV to Topology Response message
4 participants